Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

113
Views
Why does "?a=a" get added to the back of my URL on GET?

I use a post GET request with action="/sact/${searchp}/" in order to submit an user search query.

var searchp = search.querySelector("input.search-input").value;
// returns the normal value

document.body.innerHTML += `<form id="jsForm" action="/sact/${search}/" method="GET"><input type="hidden" name="a" value="a"></form>`;
document.getElementById("jsForm").submit();

This redirects here:

router.get('/sact/:where', async (req, res, next) => {
  res.render('search');
});

I can't figure out why /?a=a gets added to the back of the URL every time it gets submitted. How do I remove it?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

When you document.getElementById("jsForm").submit(); will send the form on the URL as query parameters because you are using method="GET"

The a=a is from this field <input type="hidden" name="a" value="a"> is hidden on the HTML but still will be send on the URL

if you want to "hide" you could use method="POST" won't be visible on the URL

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!